home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
kernel
/
genfun.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-16
|
3KB
|
105 lines
/* Copyright (c) 1993-1996 Algorithms Corporation */
/* All rights reserved. */
/* This file automatically generated by dpp - do not edit */
#define DPP_STRATEGY 2
#define DPP_FASTWIDE 0
#line 13 "genfun.d"
#include <string.h>
#include "kernels.h"
#define CLASS GenericFunction_c
#define ivType GenericFunction_iv_t
#include "generics.h"
object GenericFunction_c;
#include "genfun.iv"
#line 29 "genfun.d"
imeth void GenericFunction_im_gInvalidObject(object self, int argn, object arg1)
{
char buf[256];
sprintf(buf, "\nDynace: Generic %s passed an invalid object on arg %d.\n", gName(self), argn);
if (argn != 1 && arg1)
if (IsaClass(arg1))
sprintf(buf+strlen(buf), "First argument to generic %s was the class %s\n", gName(self), gName(arg1));
else
sprintf(buf+strlen(buf), "First argument to generic %s was an instance of the %s class\n", gName(self), gName(ClassOf(arg1)));
gError(self, buf);
}
imeth void GenericFunction_im_gInvalidType(object self, int argn, object arg1, object cls, object arg)
{
char buf[320];
sprintf(buf, "\nDynace: Generic %s passed an invalid object type on arg %d.\n", gName(self), argn);
sprintf(buf+strlen(buf), "Expected an instance of %s\n", gName(cls));
sprintf(buf+strlen(buf), "Received an instance of %s\n", gName(ClassOf(arg)));
if (argn != 1 && arg1)
if (IsaClass(arg1))
sprintf(buf+strlen(buf), "First argument to generic %s was the class %s\n", gName(self), gName(arg1));
else
sprintf(buf+strlen(buf), "First argument to generic %s was an instance of the %s class\n", gName(self), gName(ClassOf(arg1)));
gError(self, buf);
}
imeth char * GenericFunction_im_gName(object self)
{ GenericFunction_iv_t *iv = GetIVs(GenericFunction, self);
return iv->name;
}
imeth int GenericFunction_im_gTrace(object self, int mode)
{ GenericFunction_iv_t *iv = GetIVs(GenericFunction, self);
int pmode = iv->trace;
iv->trace = mode;
return pmode;
}
imeth objrtn GenericFunction_im_gCopy(object self)
{
return gShouldNotImplement(self, "gCopy/gDeepCopy");
}
objrtn GenericFunction_initialize(void)
{
static int done = 0;
if (done)
return GenericFunction_c;
done = 1;
iMethodFor(GenericFunction, gInvalidObject, GenericFunction_im_gInvalidObject);
iMethodFor(GenericFunction, gInvalidType, GenericFunction_im_gInvalidType);
iMethodFor(GenericFunction, gName, GenericFunction_im_gName);
iMethodFor(GenericFunction, gTrace, GenericFunction_im_gTrace);
iMethodFor(GenericFunction, gCopy, GenericFunction_im_gCopy);
iMethodFor(GenericFunction, gDeepCopy, GenericFunction_im_gCopy);
return GenericFunction_c;
}
#if 0
cmeth objrtn GenericFunction_cm_gNewWithStr(object self, char *n){}
#endif